package com.xc.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("users")
public class MyUserController {
    @PostMapping
    public String addUser() {
        System.out.println("addUser方法执行");
        return "ok";
    }

    @DeleteMapping("/{id}")
    public String delUSer(@PathVariable Integer id) {
        System.out.println("delUser方法执行" + id);
        return "ok" + id;
    }

    @PutMapping("/{id}")
    public String updateUser(@PathVariable Integer id) {
        System.out.println("update方法执行" + id);
        return "OK" + id;
    }

    @GetMapping("/{id}")
    public String selectUser(@PathVariable Integer id) {
        System.out.println("selectUser执行" + id);
        return "Ok" + id;
    }
}
